module.exports = (url, data) => {
    return new Promise((resolve, reject) => {
        wx.request({
            url: `https://applet-base-api-t.itheima.net/${url}`,
            // request方法格式与ajax类似, 通过data传递参数
            data: data,
            header: {
                "Content-Type": "application/json",
            },
            success: resolve,
            fail: reject
        });
    })
}